package com.pig4cloud.pigx.contract.mapstruct;

import com.pig4cloud.pigx.contract.entity.ContractSymbol;
import com.pig4cloud.pigx.contract.mongo.entity.ContractSymbolMongo;
import com.pig4cloud.pigx.contract.vo.AppContractSymbolDetailVO;
import com.pig4cloud.pigx.contract.vo.ContractSymbolVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * ContractSymbolStruct
 *
 * @date 2022/8/12 16:32
 */
@Mapper
public interface ContractSymbolStruct {
	ContractSymbolStruct INSTANCE = Mappers.getMapper(ContractSymbolStruct.class);

	/**
	 * 将实体类转换为vo
	 *
	 * @param entity 实体类
	 * @return {@link ContractSymbolVO}
	 * @date 2022/2/8
	 * @since 1.0.0
	 */
	@Mappings({})
	ContractSymbolVO entity2Vo(ContractSymbol entity);

	/**
	 * list转换为voList
	 *
	 * @param list 实体类集合
	 * @return {@link List<  ContractSymbolVO>}
	 * @date 2022/7/14 14:21
	 */
	List<ContractSymbolVO> list2Vo(List<ContractSymbol> list);

	/**
	 * 将实体类转换为mongo
	 *
	 * @param entity 实体类
	 * @return {@link ContractSymbolMongo}
	 * @date 2022/2/8
	 * @since 1.0.0
	 */
	@Mappings({})
	ContractSymbolMongo entity2Mongo(ContractSymbol entity);

	/**
	 * list转换为mongoList
	 *
	 * @param list 实体类集合
	 * @return {@link List< ContractSymbolMongo>}
	 * @date 2022/7/14 14:21
	 */
	List<ContractSymbolMongo> list2Mongo(List<ContractSymbol> list);

	/**
	 * 将实体类转换为mongo
	 *
	 * @param mongo mongo
	 * @return {@link ContractSymbol}
	 * @date 2022/2/8
	 * @since 1.0.0
	 */
	@Mappings({})
	ContractSymbol mongo2Entity(ContractSymbolMongo mongo);

	/**
	 * list转换为mongoList
	 *
	 * @param mongo mongo
	 * @return {@link List< ContractSymbol>}
	 * @date 2022/7/14 14:21
	 */
	List<ContractSymbol> mongo2List(List<ContractSymbolMongo> mongo);

	/**
	 * mongo转换为AppContractSymbolDetailVO
	 *
	 * @param mongo mongo
	 * @return {@link AppContractSymbolDetailVO}
	 * @date 2022/8/25 10:20
	 */
	AppContractSymbolDetailVO mongo2DetailVO(ContractSymbolMongo mongo);
}
